//
// AOperand.hpp for  in /home/seth/svn/vmtmp
// 
// Made by kevin lansel
// Login   <lansel_k@epitech.net>
// 
// Started on  Tue Feb 19 20:09:30 2013 kevin lansel
// Last update Tue Feb 19 21:56:39 2013 kevin lansel
//

#ifndef		AOPERAND_HPP_
#define		AOPERAND_HPP_

#include	<string>
#include	"IOperand.hpp"

class	AOperand : public IOperand
{
public:
  typedef struct	func
  {
    eOperandType	type;
    IOperand	*(AOperand::*function)(const std::string &);
  }	func;

public:
  AOperand(const std::string &, eOperandType);
  virtual ~AOperand();

  virtual std::string const &toString() const;
  virtual int getPrecision() const = 0;
  virtual eOperandType getType() const = 0;
  IOperand	*createOperand(eOperandType type, const std::string & value);

private:
  IOperand	*createInt8(const std::string & value);
  IOperand	*createInt16(const std::string & value);
  IOperand	*createInt32(const std::string & value);
  IOperand	*createFloat(const std::string & value);
  IOperand	*createDouble(const std::string & value);

  func			*_func_type;
  eOperandType		_type;
  std::string		_str;
};

#endif
